#!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: regex.py
# -----
# Description:
# -----
# Created  By: Aim 2020-02-03 15:02:26
# Modified By: Aim 2020-02-03 15:27:35
# -----
# HISTORY:
# Date      	By	Comments
# ----------	---	----------------------------------------------------------
###

import re

# 匹配

# print(re.match(r'^\d{3}\-\d{3,8}$', '010 12345'))


# 分割
# s = 'a b    c'.split(' ')

# s = re.split(r'\s+', 'a b   c')

# print(s)

# 分组

# m = re.match(r'^(\d{3})-(\d{3,8})$', '010-12345')
# print(m.group(0))
# print(m.group(1))
# print(m.group(2))
# print(m.groups())

# 贪婪匹配
m = re.match(r'^(\d+?)(0*)$', '102300')
print(m.groups())
